def parse_model_config(path):
    file= open(path, 'r')
    lines = file.read().split('\n')
    lines = [x for x in lines if x and not x.startswith('#')]
    lines = [x.rstrip().lstrip() for x in lines]
    moudle_defs = []
    for line in lines:
        if line.startswith('['):
            moudle_defs.append({})
            moudle_defs[-1]['type'] = line[1:-1].rstrip()
        else:
            key, value = line.split('=')
            value = value.strip()
            moudle_defs[-1][key.rstrip()] = value.strip()
    return moudle_defs